package com.ftg.learn.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ftg.learn.mapper.DeptMapper;
import com.ftg.learn.pojo.Dept;

@Service
public class DeptService {

    @Autowired
    DeptMapper deptMapper;  //代理模式

    public List<Dept> showAll(){

        return deptMapper.showall();
    }

    public int getcount(String deptno){
        deptno=("".equals(deptno) ? null : deptno);
        return deptMapper.getCount(deptno);
    }

    public int delete(int deptno) {
        return deptMapper.deleteDeptno(deptno);
    }

    public int update(Dept dept) {

        return deptMapper.update(dept);
    }

    public int add(Dept dept) {
        return deptMapper.add(dept);
    }

}
